]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
userMenu: Update the user information if the object is already loaded
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 8 Sep 2011 21:11:45 +0000 (17:11 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 19 Sep 2011 14:50:54 +0000 (10:50 -0400)
Any time we get a cached user object from the AccountsService, it will
already be loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=658605

js/ui/userMenu.js

index 24ad4183aaca71ccead2978880f925ff6ec81295..15a627a2e8048776ae06869b085db9dc382e0d17 100644 (file)
@@ -194,6 +194,10 @@ IMStatusChooserItem.prototype = {
         this._userChangedId = this._user.connect('changed',
                                                  Lang.bind(this,
                                                            this._updateUser));
+        this.actor.connect('notify::mapped', Lang.bind(this, function() {
+            if (this.actor.mapped)
+                this._updateUser();
+        }));
     },
 
     // Override getColumnWidths()/setColumnWidths() to make the item
@@ -421,6 +425,7 @@ UserMenuButton.prototype = {
         box.add(this._name, { y_align: St.Align.MIDDLE, y_fill: false });
         this._userLoadedId = this._user.connect('notify::is-loaded', Lang.bind(this, this._updateUserName));
         this._userChangedId = this._user.connect('changed', Lang.bind(this, this._updateUserName));
+        this._updateUserName();
 
         this._createSubMenu();
         this._userManager.connect('notify::is-loaded',